package com.ysh.mapper;

import com.ysh.bean.Student;
import com.ysh.bean.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/*
    学生持久层接口
 */
public interface StudentMapper {
    /*
        查询全部方法
     */
    @Select("select * from student")
    public abstract List<Student> selectAll();

    /*
        添加数据方法
     */
    @Insert("INSERT INTO student VALUES(#{number},#{name},#{birthday},#{address})")
    void addStu(Student stu);

    /*
        修改数据方法
     */
    @Update("update student set number=#{number},name=#{name},birthday=#{birthday},address=#{address} where number=#{number}")
    void updateStu(Student stu);

    /*
        删除数据方法
     */
    @Delete("delete from student where number=#{number}")
    void deleteStu(String number);
}
